<template>
            <div class="item">
            <el-collapse class="demo">
                <el-collapse-item :title="props.label">                    
                    <p class="label">~ 设置 ~</p>
                    <el-tooltip
                        class="box-item"
                        effect="dark"
                        content="点击可复制"
                        placement="top-start"
                    >
                        <p @click="copyText(props.text)">{{props.text}}</p>
                    </el-tooltip>
                </el-collapse-item>
            </el-collapse>
            <div class="template">
                <slot></slot>
            </div>
        </div>
</template>
<script lang="ts">
    import { defineComponent } from "vue";
    export default defineComponent({
        name:"BaseItem"
   })
</script>
<script lang="ts" setup>
import { copy } from 'rl-utils';
import { ElCollapse,ElCollapseItem,ElMessage,ElTooltip} from "element-plus";
const props = defineProps<{
    label: string,
    text:string
}>()
// 复制内容
const copyText = (e) => { 
    const status = copy(e)
    if (status) { 
        ElMessage.success('复制成功')
    }
}
</script>
<style lang="scss" scoped>
    @import "../../assets/css/index.scss";    
</style>